import baostock as bs
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime



# 登陆系统
from util.GetStockDat import GetStockDat

lg = bs.login()
# 获取中证500成分股
rs =  bs.query_hs300_stocks() #query_hs300_stocks()query_zz500_stocks()
df_init = []
result_list = []
N1=200
N2=48
#峰度判断
N3=4

while (rs.error_code == '0') & rs.next():
    d = rs.get_row_data()
    code = d[1]
    g =GetStockDat()
    try:
      g.GetStockDatApi(code,5,20,30,'2015-01-01',bs)
    except Exception as err:
      print("Finished with error: ", err)




# 登出系统
bs.logout()


